CSE 311: Section 6

Task 1 – RegEx to NFA

  1. Convert the regular expression “(11(01)*)00(11 \cup (01)^*) 00” to an NFA using the algorithm from lecture. You may skip adding ε\varepsilon-transitions for concatenation if they are obviously unnecessary, but otherwise, you should precisely follow the construction from lecture.

  2. Convert the regular expression “((01)(01)*)*((0 \cup 1) (01)^*)^*” to an NFA using the algorithm from lecture.

Task 2 – Irregularity

  1. Let Σ={0,1}\Sigma = \{0, 1\}. Prove that {0n1n0n:n0}\{0^n1^n0^n\;:\; n \geq 0\} is not regular.

  2. Let Σ={0,1,2}\Sigma = \{0, 1, 2\}. Prove that {0n(12)m:nm0}\{0^n(12)^m\;:\; n \geq m \geq 0\} is not regular.

Task 3 – Countability

For proving countability, you must use one of the following strategies:

  • Enumeration

  • Dovetailing

  • Subset of a countable set

  • Using a surjection (onto function) f:Sf:\mathbb{N} \to S

  • Using an injection (one-to-one function) f:Sf:S \to \mathbb{N}

For proving uncountability, you must show there exists no enumeration of the elements of SS (there exists no surjection f:Sf:\mathbb{N} \to S). This can be done using diagonalization.

  1. Prove that {3x:x}\{3x\;:\;x \in \mathbb{N}\} is countable.

  2. Prove that 𝒫()\mathcal{P}(\mathbb{N}) is uncountable.

  3. Show that ×\mathbb{N} \times \mathbb{N} is countable.

     Hint: How did we show that the rationals were countable?

  4. Show that the countable union of countable sets is countable. That is, given a collection of sets S1,S2,S2,S_1, S_2, S_2, \ldots such that SiS_i is countable for all ii \in \mathbb{N}, show that the following is countable:

    S=S1S2={x:xSi for some i}S = S_1 \cup S_2 \cup \cdots = \{ x : \text{$x \in S_i$ for some $i$} \}

     Hint: Find a way of labeling the elements and see if you can apply the previous part to construct an onto function from \mathbb{N} to SS.

Task 4 – NFAs to DFAs

  1. Convert the following NFA to a DFA for the same language:

    NFA that starts at accepting state q0.
   State q0 loops itself with 0, and goes to state q3 with edge of 2 and goes
   to state q1 with empty string. State q3 loops itself with 0. State q1 loops
   itself with the empty string and goes to accepting state q2 with 1. State q2
   loops itself with 0.
  2. Convert the following NFA to a DFA for the same language:

    NFA starts a state 'a'. Visually there
   are two paths. The top path has state 'a' to state 'b' with the empty string,
   to state 'c' with 1 to state 'd' with 1. The bottom path has state 'a' to state
   'e' with the empty string, to state 'f' with the empty to state 'g' with 0 and
   to state 'h' with 1. The top and bottom paths converge into state 'i', where state
   'd' goes to 'i' and 'h' goes to 'i' both with the empty. State 'i' goes to 'j' with 0
   , and 'j' goes to the accepting state 'k' with 0. Additionally, state 'e' goes to
   state 'i' and state 'h' goes to state 'f'.